home *** CD-ROM | disk | FTP | other *** search
/ Programming Languages Suite / ProgramD2.iso / Borland / Borland C++ V5.02 / OWLSRC.PAK / WINDOWDC.CPP < prev    next >
Encoding:
C/C++ Source or Header  |  1997-05-06  |  1.0 KB  |  77 lines

  1. //----------------------------------------------------------------------------
  2. // ObjectWindows
  3. // Copyright (c) 1992, 1997 by Borland International, All Rights Reserved
  4. //
  5. //$Revision:   10.5  $
  6. //
  7. // Implementation of classes TWindowDC, TScreenDC, TDesktopDC & TClientDC
  8. //----------------------------------------------------------------------------
  9. #include <owl/pch.h>
  10. #if !defined(OWL_DC_H)
  11. # include <owl/dc.h>
  12. #endif
  13.  
  14. OWL_DIAGINFO;
  15.  
  16. //
  17. //
  18. //
  19. TWindowDC::TWindowDC()
  20. :
  21.   TDC()
  22. {
  23. }
  24.  
  25. //
  26. //
  27. //
  28. TWindowDC::TWindowDC(HWND hWnd)
  29. :
  30.   TDC(),
  31.   Wnd(hWnd)
  32. {
  33.   Handle = ::GetWindowDC(Wnd);
  34.   CheckValid();
  35. }
  36.  
  37. //
  38. //
  39. //
  40. TWindowDC::~TWindowDC()
  41. {
  42.   RestoreObjects();
  43.   if (ShouldDelete)
  44.     ::ReleaseDC(Wnd, HDC(Handle));
  45.   Handle = 0;
  46. }
  47.  
  48. //
  49. //
  50. //
  51. TScreenDC::TScreenDC()
  52. :
  53.   TWindowDC(0)
  54. {
  55. }
  56.  
  57. //
  58. //
  59. //
  60. TDesktopDC::TDesktopDC()
  61. :
  62.   TWindowDC(::GetDesktopWindow())
  63. {
  64. }
  65.  
  66. //
  67. //
  68. //
  69. TClientDC::TClientDC(HWND wnd)
  70. :
  71.   TWindowDC()
  72. {
  73.   Wnd = wnd;
  74.   Handle = ::GetDC(Wnd);
  75.   CheckValid();
  76. }
  77.